<?php
if(isset($_POST) && !empty($_POST['matricule']) && !empty($_POST['classenv']) && 
!empty($_POST['emission'])&& !empty($_POST['kilometrage']) && 
!empty($_POST['gln']))
 {
  //connection a la bdd
  $sql = new db();
  
   //recupération des données
  $matricule="'".$_POST['matricule']."'";
  $etat="'".$_POST['etat']."'";
  $emission="'".$_POST['emission']."'";
  $kilometrage="'".$_POST['kilometrage']."'";
  $gln="'".$_POST['gln']."'";
  $req = "insert into camion values ($matricule, $etat, $emission, $kilometrage, $gln)";
  $sql->query($req);
  $error = '<p>Le camion &#224 &#233t&#233 ajout&#233 correctement.</p>';
 }
 else
 {
    $error = '<p>Vous avez oubli&eacute de remplir un champ.</p>';
 }   
?>